import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
import List from "./List";
import Add from "./Add";
import Put from "./Put";
import Classify from "./Classify";

function Default(props) {
  const baseUrl = props.match.path; // /manage/article
  return (
    <div>
      <Switch>
        <Route path={baseUrl + "/list"} component={List} />
        <Route path={baseUrl + "/add"} component={Add} />
        <Route path={baseUrl + "/put/:id"} component={Put} />
        <Route path={baseUrl + "/classify/"} component={Classify} />
        <Redirect exact from={baseUrl} to={baseUrl + "/list"} />
      </Switch>
    </div>
  );
}
export default Default;
